package dat215projekt.data;

import java.util.LinkedList;
import java.util.List;
import se.chalmers.cse.dat215.project.ProductCategory;

public enum BaseProductCategory {
    BREAD_BAKE, FRUIT_VEG, MEAT_FISH_DAIRY, PASTA_RICE_POTATOES, DRINKS_SWEETS;

    public static List<ProductCategory> getCategories(BaseProductCategory baseCat){
        List<ProductCategory> result = new LinkedList<ProductCategory>();
        switch (baseCat){
            case BREAD_BAKE:
                result.add(ProductCategory.BREAD);
                result.add(ProductCategory.FLOUR_SUGAR_SALT);
                result.add(ProductCategory.NUTS_AND_SEEDS);
                break;
            case FRUIT_VEG:
                result.add(ProductCategory.HERB);
                result.add(ProductCategory.FRUIT);
                result.add(ProductCategory.MELONS);
                result.add(ProductCategory.VEGETABLE_FRUIT);
                result.add(ProductCategory.CABBAGE);
                result.add(ProductCategory.EXOTIC_FRUIT);
                result.add(ProductCategory.BERRY);
                result.add(ProductCategory.POD);
                result.add(ProductCategory.CITRUS_FRUIT);
                break;
            case MEAT_FISH_DAIRY:
                result.add(ProductCategory.MEAT);
                result.add(ProductCategory.FISH);
                result.add(ProductCategory.DAIRIES);
                break;
            case PASTA_RICE_POTATOES:
                result.add(ProductCategory.PASTA);
                result.add(ProductCategory.POTATO_RICE);
                result.add(ProductCategory.ROOT_VEGETABLE);
                break;
            case DRINKS_SWEETS:
                result.add(ProductCategory.HOT_DRINKS);
                result.add(ProductCategory.COLD_DRINKS);
                result.add(ProductCategory.SWEET);
                break;
            default: throw new IllegalArgumentException("Invalid category");
        }

        return result;
    }
}
